package com.yang.ddd.application.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yang.ddd.domain.space.entity.SpaceLevel;
import com.yang.ddd.infrastructure.common.DeleteRequest;
import com.yang.ddd.interfaces.dto.space.SpaceAddRequest;
import com.yang.ddd.interfaces.dto.space.SpaceEditRequest;
import com.yang.ddd.interfaces.dto.space.SpaceQueryRequest;
import com.yang.ddd.domain.space.entity.Space;
import com.yang.ddd.domain.user.entity.User;
import com.yang.ddd.interfaces.dto.space.SpaceUpdateRequest;
import com.yang.ddd.interfaces.vo.space.SpaceVO;

import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.List;
import java.util.Set;


/**
* @author Young
* @description 针对表【space(图片)】的数据库操作Service
* @createDate 2025-04-01 23:25:31
*/
public interface SpaceApplicationService {

    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);

    void fillSpaceBySpaceLevel(Space space);

    void validSpace(Space space, boolean add);


    SpaceVO getSpacecVO(Space space, HttpServletRequest request);


    Wrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);


    void checkSpaceAuth(User loginUser, Space space);


    Space getById(Long spaceId);


    List<Space> list(QueryWrapper<Space> queryWrapper);

    List<Space> listByIds(Set<Long> spaceIdSet);

    /**
     *
     * @param finalSpaceId 空间id
     * @param picSize  更新大小
     * @param b true：消耗额度空间 false：增加额度空间
     * @return
     */
    boolean updateQuota(Long finalSpaceId, Long picSize, boolean b);


    Page<Space> listSpaceByPage(SpaceQueryRequest spaceQueryRequest);

    Page<SpaceVO> listSpaceVOByPage(SpaceQueryRequest spaceQueryRequest);

    List<SpaceLevel> listSpaceLevel();

    SpaceVO getSpaceVOById(long id, HttpServletRequest request);

    Boolean deleteSpace(DeleteRequest deleteRequest, HttpServletRequest request);

    void editSpace(SpaceEditRequest spaceEditRequest, HttpServletRequest request);

    void updateSpace(SpaceUpdateRequest spaceUpdateRequest);

}
